package com.abel.domain.types;

import java.util.ArrayList;
import java.util.List;

public enum State {
	AL("AL", "Alabama"),
	AK("AK", "Alaska"),
	AZ("AZ", "Arizona"),
	AR("AR", "Arkansas"),
	CA("CA", "California"),
	CO("CO", "Colorado"),
	CT("CT", "Connecticut"),
	DE("DE", "Delaware"),
	DC("DC", "District of Columbia"),
	FL("FL", "Florida"),
	GA("GA", "Georgia"),
	HI("HI", "Hawaii"),
	ID("ID", "Idaho"),
	IL("IL", "Illinois"),
	IN("IN", "Indiana"),
	IA("IA", "Iowa"),
	KS("KS", "Kansas"),
	KY("KY", "Kentucky"),
	LA("LA", "Louisiana"),
	ME("ME", "Maine"),
	MD("MD", "Maryland"),
	MA("MA", "Massachusetts"),
	MI("MI", "Michigan"),
	MN("MN", "Minnesota"),
	MS("MS", "Mississippi"),
	MO("MO", "Missouri"),
	MT("MT", "Montana"),
	NE("NE", "Nebraska"),
	NV("NV", "Nevada"),
	NH("NH", "New Hampshire"),
	NJ("NJ", "New Jersey"),
	NM("NM", "New Mexico"),
	NY("NY", "New York"),
	NC("NC", "North Carolina"),
	ND("ND", "North Dakota"),
	OH("OH", "Ohio"),
	OK("OK", "Oklahoma"),
	OR("OR", "Oregon"),
	PA("PA", "Pennsylvania"),
	RI("RI", "Rhode Island"),
	SC("SC", "South Carolina"),
	SD("SD", "South Dakota"),
	TN("TN", "Tennessee"),
	TX("TX", "Texas"),
	UT("UT", "Utah"),
	VT("VT", "Vermont"),
	VI("VI", "Virginia"),
	WA("WA", "Washington"),
	WV("WV", "West Virginia"),
	WI("WI", "Wisconsin"),
	WY("WY", "Wyoming");

	/**
	 * state code
	 */
	private String stateCode;
	
	/**
	 * state name
	 */
	private String stateName;
	
	private State(String stateCode, String stateName) {
		this.stateCode = stateCode;
		this.stateName = stateName;
	}
	
	public String getStateCode() {
		return this.stateCode;
	}
	
	public String getStateName() {
		return this.stateName;
	}
	
	public static List<String> getStateCodes() {
		
		List<String> stateCodes = new ArrayList<String>();
		
		for (State state : State.values()) {
			stateCodes.add(state.getStateCode());
		}
		return stateCodes;
	}
	
	public static List<String> getStateNames() {
		
		List<String> stateCodes = new ArrayList<String>();
		
		for (State state : State.values()) {
			stateCodes.add(state.getStateName());
		}
		return stateCodes;
	}
	
	
	
	
	public static String getStateName(String stateCode) {
		
		if (stateCode != null) {
			
			for (State state : State.values()) {
				if (state.getStateCode().equals(stateCode) ) {
					return state.getStateName();
				}
			}
		}
		return null;
	}
}
